A memory whose data is protected against transient errors using error correcting code (ECC) is called an ECC memory. Error-correcting code (ECC) memory is a type of computer data storage that can detect and correct the most common kinds of internal data corruption. ECC memory is used in computers where data corruption cannot be tolerated under nearly any circumstances, such as for, safety, scientific and/or financial computing. ECC memory has Error Correcting Code (ECC) bits along with data to facilitate detection and correction of errors. The extra error correcting code bits can be stored along with the data in the data memory or in a separate code memory of the ECC memory. A common error correcting code, a single-error correction and double-error detection (SECDED) Hamming code, allows a single-bit error to be corrected and double-bit errors to be detected.
In some examples, ECC memory maintains a memory system immune to single-bit errors. That is, the data that is read from each word in ECC memory is the same as the data that had been written to the ECC memory, even if one or more bits previously stored have been flipped to the wrong state. ECC schemes may be based on a data size that is larger than a smallest size of data that can be written, which is referred to a “partial data write”. For such partial data writes, a read-modify-write operation is performed. To execute a read-modify-write operation, data is read data from the memory and checked for errors using the ECC checking logic. In case of a single bit error (SBE), the data is repaired using correction logic and corrected read data is then combined with the partial write data and written into the data memory. Combined data is also used to compute a new ECC code to be written into the code memory.